﻿@model IList<PackageModel>
@using Telerik.Web.Mvc
@using Telerik.Web.Mvc.UI
@using Logistics.Web.Models.Order
@{
    // +string+
    ViewBag.Title = "Download Shipping Label";
    Layout = "~/Views/Shared/_Layout";
    var gridPageSize = Nop.Core.Infrastructure.EngineContext.Current.Resolve<Nop.Core.Domain.Logistics.LogisticsInformationSettings>().GridPageSize;
}
<div class="window">
    <div class="window-title grad-lightgrey grad">
        <div class="window-title-bar grad-titleshine grad">
            <h2>Download Shipping Label</h2>
        </div>
    </div>
    <div class="window-content">

        @(Html.Telerik().Grid(Model)
            .Name("download-package-grid")
            .Columns(columns =>
            {
                columns.Bound(x => x.Id);
                columns.Bound(x => x.PickUpAddress).Width(350);
                columns.Bound(x => x.DeliveryAddress).Width(350);
                columns.Bound(x => x.Id)
                    .Template(x => Html.ActionLink("Print", "DownloadWaybill", "Order", new { id = x.Id }, new { @class = "button-grey download-link", target = "_blank" }))
                    .Centered()
                    .Title("Shipping Label");

            }))
        <div class="window-content space">
            @if (!String.IsNullOrEmpty(ViewBag.ContinueShoppingUrl))
            {
                <div class="returnrequest-buttons">
                    @Html.ActionLink("Return to My HUB", "Tracking", "Customer", new { area = "" }, new { @class = "button-grey" })
                    <input type="button" value="Continue Shopping" class="button-grey order-completed-continue-button" onclick="setLocation('@ViewBag.ContinueShoppingUrl')" />
                </div>
            }
            else
            {
                <div class="download-buttons">
                    @Html.ActionLink("Return to My HUB", "Tracking", "Customer", new { area = "" }, new { @class = "button-grey" })  
                    @Html.ActionLink("Place New Order", "OrderInfo", "Order", null, new { @class = "button-red" })
                </div>
            }
        </div>
    </div>
</div>

